package com.kobe.manager.purposeManager.service.impl;

import java.util.List;
import com.kobe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.kobe.manager.purposeManager.mapper.PurposeMapper;
import com.kobe.manager.purposeManager.domain.Purpose;
import com.kobe.manager.purposeManager.service.IPurposeService;

/**
 * 采购意向Service业务层处理
 *
 * @author panchengjiang
 * @date 2025-10-23
 */
@Service
public class PurposeServiceImpl implements IPurposeService
{
    @Autowired
    private PurposeMapper purposeMapper;

    /**
     * 查询采购意向
     *
     * @param purposeId 采购意向主键
     * @return 采购意向
     */
    @Override
    public Purpose selectPurposeByPurposeId(Long purposeId)
    {
        return purposeMapper.selectPurposeByPurposeId(purposeId);
    }

    /**
     * 查询采购意向列表
     *
     * @param purpose 采购意向
     * @return 采购意向
     */
    @Override
    public List<Purpose> selectPurposeList(Purpose purpose)
    {
        return purposeMapper.selectPurposeList(purpose);
    }

    /**
     * 新增采购意向
     *
     * @param purpose 采购意向
     * @return 结果
     */
    @Override
    public int insertPurpose(Purpose purpose)
    {
        purpose.setCreateTime(DateUtils.getNowDate());
        return purposeMapper.insertPurpose(purpose);
    }

    /**
     * 修改采购意向
     *
     * @param purpose 采购意向
     * @return 结果
     */
    @Override
    public int updatePurpose(Purpose purpose)
    {
        purpose.setUpdateTime(DateUtils.getNowDate());
        return purposeMapper.updatePurpose(purpose);
    }

    /**
     * 批量删除采购意向
     *
     * @param purposeIds 需要删除的采购意向主键
     * @return 结果
     */
    @Override
    public int deletePurposeByPurposeIds(Long[] purposeIds)
    {
        return purposeMapper.deletePurposeByPurposeIds(purposeIds);
    }

    /**
     * 删除采购意向信息
     *
     * @param purposeId 采购意向主键
     * @return 结果
     */
    @Override
    public int deletePurposeByPurposeId(Long purposeId)
    {
        return purposeMapper.deletePurposeByPurposeId(purposeId);
    }
}
